package com.study.spmongodb.wwj.thread.char10;

import java.util.Collection;

/**
 * @author MI
 * @version 1.0
 * @date 2020/12/6 16:03
 */
public interface Lock {
    class TimeOutException extends Exception {
        public TimeOutException(String msg) {
            super(msg);
        }
    }

    void lock() throws InterruptedException;

    void lock(long mills) throws InterruptedException, TimeOutException;

    void unlock();

    Collection<Thread> getBlockedThread();

    int getBlockSize();

}
